# 版本: 1.0.0.20250825
# 作者: 陈振玺
# 功能: R-VizCraft工具的Docker镜像配置文件

# 使用ubuntu:20.04作为基础镜像
FROM ubuntu:20.04

# 设置环境变量避免交互式安装
ENV DEBIAN_FRONTEND=noninteractive

# 更新包列表并安装R及必要的系统依赖
RUN apt-get update && apt-get install -y \
    r-base \
    r-base-dev \
    libcurl4-openssl-dev \
    libssl-dev \
    libxml2-dev \
    libcairo2-dev \
    libxt-dev \
    libudunits2-dev \
    libgdal-dev \
    libgeos-dev \
    libproj-dev \
    libfontconfig1-dev \
    libfreetype6-dev \
    libpng-dev \
    libtiff5-dev \
    libjpeg-dev \
    libicu-dev \
    zlib1g-dev \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# 创建工作目录
WORKDIR /app

# 复制install.R文件到镜像中
COPY scripts/install.R ./

# 执行install.R脚本安装依赖
RUN Rscript install.R

# 设置默认命令
CMD ["/bin/bash"]